package com.atguigu.srb.core.controller.admin;

import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.entity.LendItem;
import com.atguigu.srb.core.service.LendItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: Bright
 * @Date: 2022-04-28 16:45
 * @Description: com.atguigu.srb.core.controller.admin
 * @version: 1.0
 */
@Slf4j
@RestController
@Api(tags = "投资项")
@RequestMapping("/admin/core/lendItem")
public class AdminLendItemController {
    @Resource
    LendItemService lendItemService;

    @ApiOperation(value = "得到投资项列表")
    @GetMapping("/list/{lendId}")
    public R list(
            @ApiParam(value = "标的id",required = true)
            @PathVariable Long lendId){

     return R.ok().data("list",lendItemService.listByLendId(lendId));
    }

}
